﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;

using System.Data.Common;
using Mocola.BLL;
using Mocola.Model;
using Mocola.Net.Web.Utility;
using System.Collections.Generic;
using Mocola.Security;
using Mocola.Web;
using Mocola.Common;


namespace Mocola.Net.Web
{
    public partial class borrowlist : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                BindData();
            }
        }

        private void BindData()
        {
            string sql = @"SELECT ID,
                                  BuMen,
                                  ShenQingRen,
                                  ShenQingRiQi,
                                  CASE FangShi WHEN 0 THEN '领用' WHEN 1 THEN '借用' WHEN 2 THEN '打印' ELSE '-' END AS FangShi,
                                  NR_YuanJian,
                                  NR_FuYinJian,
                                  NR_GuangPan,
                                  ShuLiang,
                                  GuiHuanRiQi,
                                  CASE LieBie WHEN 'P' THEN '项目类' ELSE '管理类' END AS LieBie,
                                  CASE FenLei WHEN 'M' THEN '图纸类' WHEN 'F' THEN '文件类' ELSE '外来文件类' END AS FenLei 
                          FROM Moc_UseBorrow WHERE ShenHeZhuangTai=0";
            DataSet dt = Databases.MocolaNet.ExecuteDataSet(CommandType.Text, sql);
            DataView dv = dt.Tables[0].DefaultView;
            dv.Sort = "ShenQingRiQi";
            rptBorrow.DataSource = dv;
            rptBorrow.DataBind();
        }

        protected void rptBorrow_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {

        }
    }
}
